package com.dd.common.dto.system.user;

import com.dd.common.pojo.dto.TimeDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Schema(description = "系统用户查询DTO")
@EqualsAndHashCode(callSuper = true)
@Data
public class SysUserQueryDTO extends TimeDTO implements Serializable {
    @Schema(description = "账号用户名（仅限字母、数字、下划线）", example = "admin_user_1")
    @Pattern(regexp = "^[a-zA-Z0-9_]{1,30}$", message = "用户名必须由1-30位字母、数字或下划线组成")
    private String username;
    @Schema(description = "昵称", example = "如烟大帝")
    private String nickname;
    @Schema(description = "真实姓名", example = "柳如烟")
    private String realName;
    @Schema(description = "性别（0-未知，1-男，2-女）", example = "1")
    @Range(min = 0, max = 2, message = "性别只能是0、1或2")
    private Integer gender;

    @Schema(description = "状态（0-禁用，1-正常）", example = "1")
    @Range(min = 0, max = 1, message = "状态只能是0或1")
    private Integer status;

    @Schema(description = "角色ID", example = "1")
    @Min(value = 1, message = "角色ID必须是正整数")
    private Integer roleId;

    @Schema(description = "部门ID", example = "1")
    @Min(value = 1, message = "部门ID必须是正整数")
    private Integer deptId;

    @Schema(description = "职位ID", example = "1")
    @Min(value = 1, message = "职位ID必须是正整数")
    private Integer positionId;

}
